
import { FontSize as OriginalFontSize } from "element-tiptap";
import CustomMenuButton from './MenuButton.vue'

export default class FontSize extends OriginalFontSize {
    constructor(option = {}) {
        super(option)
        this.fontSizes = option.fontSizes || ['8', '10', '12', '14', '16', '18', '20', '24', '30', '36', '48', '60', '72']
    }
    menuBtnView(editorContext) {
        return {
            component: CustomMenuButton,
            componentProps: {
                fontSizes: this.fontSizes,
                isActive: editorContext.isActive.font_size()
            },
            componentEvents: {
                command(fontSize) {
                    editorContext.commands.font_size(fontSize)
                }
            }
        };
    }
}